<h1>Listing queued_downloads</h1>

<table>
  <tr>
    <th>Show</th>
    <th>Season</th>
    <th>Episode</th>
    <th>Status</th>
    <th>Percent Done</th>
    <th>DL Rate</th>
    <th>UP Rate</th>
    <th>Time Left</th>
    <th>Actions</th>
  </tr>
  
<% for queued_download in @queued_downloads %>
<% episode = queued_download.get_episode %>
<% show = episode.get_show%>
  <tr>
    <td><%= show.title %></td>
    <td><%= episode.season%></td>
    <td><%= episode.episode%></td>
    <td><%= episode.torrent_status %></td>
    <td><%if !queued_download.bt.nil? %><%= queued_download.bt.percent_done%><%else%>N/A<%end%></td>
    <td><%if !queued_download.bt.nil? %><%= queued_download.bt.dl_rate%><%else%>N/A<%end%></td>
    <td><%if !queued_download.bt.nil? %><%= queued_download.bt.ul_rate%><%else%>N/A<%end%></td>
    <td><%if !queued_download.bt.nil? %><%= queued_download.bt.time_left%><%else%>N/A<%end%></td>
    <td><%if !queued_download.bt.nil? %><%= queued_download.bt.percent_done%><%else%>N/A<%end%></td>
    <td>
    <%= link_to 'Show', :action => 'show', :id => queued_download %>
    <%= link_to 'Edit', :action => 'edit', :id => queued_download %>
    <%= link_to 'Destroy', { :action => 'destroy', :id => queued_download }, :confirm => 'Are you sure?', :method => :post %>
    <% if queued_download.bt.nil? %>
    <%= link_to 'Start', { :action => 'start_download', :id => queued_download } %>
    <% end %>
    </td>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @queued_download_pages.current.previous } if @queued_download_pages.current.previous %>
<%= link_to 'Next page', { :page => @queued_download_pages.current.next } if @queued_download_pages.current.next %> 

<br />
